![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-input-autosize
Advanced tools
The react-input-autosize package is a React component that automatically adjusts the width of the input field to fit the content typed by the user. This is particularly useful for tags input and other dynamic text inputs where the size of the content can change.
Autosizing input field
This feature allows the input field to automatically resize based on the input content. The width of the input will grow or shrink as the user types or deletes content.
{"import AutosizeInput from 'react-input-autosize';\n\nfunction MyComponent() {\n const [value, setValue] = useState('');\n\n return (\n <AutosizeInput\n value={value}\n onChange={(e) => setValue(e.target.value)}\n />\n );\n}"}
This package provides a textarea element that automatically resizes as content changes. It's similar to react-input-autosize but is specifically designed for textarea elements instead of input fields.
Similar to react-autosize-textarea, this package is for textarea elements that automatically adjust their height to the content. It offers a similar functionality to react-input-autosize but for multi-line text areas.
This package is similar to react-input-autosize and provides an input field that adjusts its width to the content. It's a lightweight alternative that can be used outside of React as well.
A text input for React that resizes itself to the current content.
Live demo: jedwatson.github.io/react-input-autosize
To run the examples locally, run:
npm install
gulp dev
Then open localhost:8000 in a browser. This will also watch for file changes and rebuild the examples (includes live reload).
To just build the examples without the dev server or watch tasks, instead run:
gulp build-examples
The easiest way to use React-Input-Autosize is to install it from NPM and include it in your own React build process (using Browserify, etc).
You can also use the standalone build by including dist/AutosizeInput.js
in your page. If you use this, make sure you have already included React and Underscore. (they must be available through a browserify-style require()
call, standalone support is coming soon)
npm install react-input-autosize --save
React-Input-Autosize generates an input field, wrapped in a <div>
tag so it can detect the size of its value. Otherwise it behaves very similarly to a standard React input.
var AutosizeInput = require('react-input-autosize');
<AutosizeInput
name="form-field-name"
value={inputValue}
onChange={function(event) {
// event.target.value contains the new value
}}
/>
(The MIT License)
Copyright (c) 2015 Jed Watson.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Auto-resizing Input Component for React
The npm package react-input-autosize receives a total of 321,596 weekly downloads. As such, react-input-autosize popularity was classified as popular.
We found that react-input-autosize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.